Skip to content

fix(init): validate apply-patchset paths generically#1042

Merged
betegon merged 1 commit into
mainfrom
fix/init-install-patch-paths
Jun 1, 2026
Merged

fix(init): validate apply-patchset paths generically#1042
betegon merged 1 commit into
mainfrom
fix/init-install-patch-paths

Conversation

@betegon
Copy link
Copy Markdown
Member

@betegon betegon commented Jun 1, 2026

Summary

Moves install patch path safety to the CLI apply-patchset tool boundary. The tool now rejects absolute paths, drive-prefixed paths, backslashes, empty segments, ., and .. as normal tool errors, while still allowing ordinary nested project-relative files like .csproj paths.

This pairs with the cli-init-api change that stops hardcoding package-manager metadata filenames: https://github.com/getsentry/cli-init-api/pull/170.

Test Plan

  • pnpm exec biome check src/lib/init/tools/apply-patchset.ts test/lib/init/tools/filesystem-tools.test.ts
  • pnpm exec vitest run test/lib/init/tools/filesystem-tools.test.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1042/

Built to branch gh-pages at 2026-06-01 11:18 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Codecov Results 📊

✅ Patch coverage is 80.65%. Project has 4296 uncovered lines.
✅ Project coverage is 82.03%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/init/tools/apply-patchset.ts 80.65% ⚠️ 6 Missing and 2 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.99%    82.03%    +0.04%
==========================================
  Files          329       329         —
  Lines        23883     23908       +25
  Branches     15603     15630       +27
==========================================
+ Hits         19581     19612       +31
- Misses        4302      4296        -6
- Partials      1651      1650        -1

Generated by Codecov Action

@betegon betegon marked this pull request as ready for review June 1, 2026 11:36
@betegon betegon merged commit 09bbe84 into main Jun 1, 2026
27 checks passed
@betegon betegon deleted the fix/init-install-patch-paths branch June 1, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant